import java.util.Random;

public class test33 {
 //六个评委打分,分数范围为[0~100]之间的整数,去掉最高分,去掉最低分,算出四个评委的平均分.完成后计算选手的得分.
    public static void main(String[] args) {
        int[] a = new int[6];
        int temp=a[0];
        Random r =new Random();
        for (int i = 0; i < a.length; i++) {
            a[i] = r.nextInt(101);
            System.out.println("评委的打分为"+a[i]);
     }
        for (int i = 0; i < a.length; i++) {
            for(int j =a.length-1;j>i;j--) {
                if (a[i] < a[j]) {
                    temp = a[i];
                    a[i] = a[j];
                    a[j] = temp;
                }
            }
        }
        double sum=0;
        for (int i = 1; i < a.length-1; i++) {
             sum+= a[i];
        }
        sum=(double)sum/4;
        System.out.println("选手的综合得分为" + sum);
        }

    }

